
 ***graphs
 set scheme plotplain 

  
  
	   
*   Figure 1

  use "Temp/Master", clear 

			   * balanced sample post 1900 only
				   drop if year<1900
				   drop if expansion==1
				   
				   
	   
				* generate variables of interest 
				 gen tax_non_trade_real_median = tax_non_trade_real 
				 collapse (mean) tax_non_trade_real  ordinary_real (median) tax_non_trade_real_median if expansion == 0, by(year)	
				 
				 * plot 
				 line tax_non_trade_real tax_non_trade_real_median ordinary_real year	,  plotregion(margin(0)) bgcolor(white)  bgcolor(white)  ytitle("Real revenue (labor days per capita)") xtitle("Year" ) yla(,nogrid) xla(,nogrid)  ylabel(0(20)100)  xscale(r(1900,2020))       xlabel(1900(10)2020)   legend(pos(11) ring(0) label(1 "Taxes, excl. trade & resources (mean)") label(2 "Taxes, excl. trade & resources (median)") label(3 "Ordinary revenues (mean)") ) 
				 graph export   "Output/Graphs/Main/Figure1a.eps", replace
				 
				 
				 
*   Figure 2
 
  
   use "Temp/Master", clear /// Balanced sample overview
   
   

			   * balanced sample post 1900 only
				   drop if year<1900
				   drop if expansion==1
				   

					rename year YEAR 
					label var YEAR "Year"
					sort iso YEAR
				
		
 
				* generate variables of interest 
				
				 
				gen s_DIRECT_NOMINAL=DIRECT_NOMINAL/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL)  
				gen s_NONTAX_ORDINARY_NOMINAL=NONTAX_ORDINARY_NOMINAL/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL)  
				gen s_RESOURCES_NOMINAL=RESOURCES_NOMINAL/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL) 
				gen s_TRADE_TAXES_NOMINAL=TRADE_TAXES_NOMINAL/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL) 
				gen s_INDIRECT_EXCL_TR_NOMINAL=INDIRECT_EXCL_TR_NOMINAL/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL) 
				gen s_tax_nontrade=(DIRECT_NOMINAL+INDIRECT_EXCL_TR_NOMINAL)/(INDIRECT_NOMINAL + DIRECT_NOMINAL + NONTAX_ORDINARY_NOMINAL + RESOURCES_NOMINAL) 
			

				
				collapse (mean) s_DIRECT_NOMINAL s_NONTAX_ORDINARY_NOMINAL s_RESOURCES_NOMINAL s_TRADE_TAXES_NOMINAL s_INDIRECT_EXCL_TR_NOMINAL , by(YEAR)

						gen percent1 = s_DIRECT_NOMINAL /(s_DIRECT_NOMINAL + s_NONTAX_ORDINARY_NOMINAL + s_RESOURCES_NOMINAL + s_TRADE_TAXES_NOMINAL + s_INDIRECT_EXCL_TR_NOMINAL)
						gen percent2 = 	(percent1+s_INDIRECT_EXCL_TR_NOMINAL)	/(s_DIRECT_NOMINAL + s_NONTAX_ORDINARY_NOMINAL + s_RESOURCES_NOMINAL + s_TRADE_TAXES_NOMINAL + s_INDIRECT_EXCL_TR_NOMINAL)
						gen percent3 = (percent2+ s_TRADE_TAXES_NOMINAL) /(s_DIRECT_NOMINAL + s_NONTAX_ORDINARY_NOMINAL + s_RESOURCES_NOMINAL + s_TRADE_TAXES_NOMINAL + s_INDIRECT_EXCL_TR_NOMINAL)
						gen percent4 =  (percent3+s_NONTAX_ORDINARY_NOMINAL)/(s_DIRECT_NOMINAL + s_NONTAX_ORDINARY_NOMINAL + s_RESOURCES_NOMINAL + s_TRADE_TAXES_NOMINAL + s_INDIRECT_EXCL_TR_NOMINAL)
						gen percent5 =1
						gen zero = 0 
						
						forvalues r=1/5{
							replace percent`r'=percent`r'*100
						}
						
				* plot 
				
						twoway rarea zero percent1 YEAR /// 
							|| rarea percent1 percent2 YEAR /// 
							|| rarea percent2 percent3 YEAR /// 
							|| rarea percent3 percent4 YEAR /// 
							|| rarea percent4 percent5 YEAR  /// 
							||, legend(order(5 "Resource revenues" 4 "Non-tax revenues" 3 "Trade taxes" 2 "Indirect taxes proper" 1 "Direct taxes") pos(3) cols(1)) /// 
							 xla(1900(10)2020 ,nogrid) yla(,nogrid) ytitle("% of total ordinary revenue")   graphregion(color(white))    bgcolor(white)  legend(off) ///
							 text(10 1990  "Direct taxes"  33 1990 "Indirect taxes proper" 60 1990 "Trade taxes"  82 1990 "Non-tax revenue" 95 1990 "Resource revenue"  , color(white)  )
							 
						graph export "Output/Graphs/Main/Figure1b.pdf" , replace
				  
	 
						 
